Migrating Your Flash Applications to Macromedia Central
Table of Contents
New Features in Macromedia Central
Let's take a look at what new functionality is built into the specialized version of Flash Player for Central. Flash Player in Central is actually based on Flash Player 6, not Flash Player 7. This specialized player includes some Flash Player 7 optimizations along with some new features that I describe below.
Support for Additional Image Formats
As you may know, Flash inherited the ability to dynamically load JPEGs starting with Flash Player 6. This was a big step in the evolution of Flash Player. To this day, however, Flash does not support the loading of other image file formats due to limitations imposed on the player's file size. Because of fewer restrictions on its size, Macromedia Central has built-in support for GIFs. Transparent GIF files are supported too; however, animated GIFs are not. In addition, Central can load progressive JPEGs. This new functionality helps support web services that may provide these proprietary image formats for use with standard web browsers.
Operating System Level Tooltips
Macromedia Central taps into the operating system to support OS-level tooltips. The implementation API couldn't be any simpler:
icon_mc.tooltipText = "This is a Tooltip";
When a user rolls over the icon, after a slight delay a tooltip appears. Central determines when the tooltips should be displayed and removed; no additional code is needed
Clearing the tooltip (removing the tooltip functionality from the movie clip) is just as easy:
icon_mc.tooltipText = "";
For those who aren't quite familiar with tooltips or their function, tooltips
are used essentially to add a verbose description to text, buttons, icons,
or other images—especially when icons appear without descriptive text underneath.
Similar to the alt attribute in HTML, tooltips are a usability
utility that help make applications accessible.
Consuming Web Services
Web services allow applications to cite data from other sources, regardless of how that data is stored or what platform the services are located on. Macromedia Central's built-in support for web services makes communication with these remote services a breeze using standard SOAP and XML-RPC protocols. If you're familiar with the Web Services API within Flash MX 2004, the implementation is quite the same:
myWebService = new WebService("http://www.myCompany.com/myService.wsdl");
callback1 = myWebService.getWeather("02451");
callback1.onResult = function(result)
{
trace(resut);
}
The XML-RPC (Remote Procedure Call) is just as easy:
myRPCFactory = new RPCFactory(http://www.myCompany.com/myRPC.xml) ;
callback1 = myRPCFactory.createCall("methodName", Arg1, Arg2) ;
callback1.onResult = function(result)
{
trace(result);
}
Implementation of Regular Expressions
Based on the ECMAScript standard, Macromedia Central supports an API for regular expression evaluation (pattern matching):
html_str = "This is an HTML <b>string</b>";
bold_re = new RegExp("<b>(.*?)</b>");
result = bold_re.match(html_str); // result[0] == "string"
Macromedia uses Perl Compatible Regular Expressions, or PCRE (www.pcre.org), for its regular expression library, which uses Perl's regular expression syntax. Read more about it:
-
Syntax of Regular Expressions in Perl (Perldoc.com)
www.perldoc.com/perl5.8.0/pod/perlre.html -
Perl Regular Expressions
www.icgeb.org/~netsrv/perl/perlre.html
The following are examples of implementation of these methods:
-
Perl Regular Expression Mastery
http://perl.plover.com/yak/regex/ -
Regular Expressions in Perl (Jukka Korpela)
www.cs.tut.fi/~jkorpela/perl/regep.html -
Perl Regular Expression
http://piglet.uccs.edu/~cs301/perl/re.htm -
Perl RegExp Quick Reference (Web.Blazonry, contains some really good examples)
www.blazonry.com/perl/regexps.php